package messaging;

import java.util.ArrayList;
import java.util.List;

import javax.ejb.Stateless;

/**
 * Session Bean implementation class MessageContainer
 */
@Stateless
public class MessageContainer implements MessageContainerRemote {

	private List<String> messages = null;

	public MessageContainer() {
		messages = new ArrayList<>();
	}

	@Override
	public List<String> getMessages() {
		return messages;
	}

	public void setMessages(List<String> messages) {
		this.messages = messages;
	}

	@Override
	public void addMessage(String message) {
		System.out.println("am adaugat urmatorul mesaj: " + message);
		this.messages.add(message);
	}

}
